<template>
	<view>
		<view class="Comcontent" style="background-color: aqua;">
			<text class="title">子组件A</text>
			<view class="coma_box">
				<text>父组件传来的值：</text>
				<text style="color: red; font-weight: bold;">{{intent}} </text>
			</view>
			<button type="primary" @click="sendData()">传值给comB</button>
		</view>
	</view>
</template>

<script>
	export default {
		props:['intent'],
		name:"comA",
		data() {
			return {
			};
		},
		created() {
			console.log("ComA-----created");
		},
		mounted() {
			console.log("ComA-----mouted");
		},
		methods:{
			sendData(){
				console.log("ComA-----SendData");
				uni.$emit('SendIntent',this.intent)
			}
		}
	}
</script>

<style>
	.Comcontent{
		width: 80%;
		padding: 10rpx;
		margin: 0 auto;
		
	}
	button{
		width:60%;
		margin-bottom: 30rpx;
		margin-top: 20rpx;
	}

</style>